
//移入移出
if(document.body.offsetWidth>600){
    var rr = document.querySelector("#rr");
    var hh = document.querySelector(".hh");

    rr.addEventListener("mouseover",function () {
        hh.style.display = "block";
    });
    rr.addEventListener("mouseleave",function () {
        hh.style.display = "none";
    });
    hh.addEventListener("mouseover",function () {
        hh.style.display = "block";
    });
    hh.addEventListener("mouseleave",function () {
        hh.style.display = "none";
    });
}

if(document.body.offsetWidth>600) {
    var ss = document.querySelector(".btn-open");
    var mtk = document.querySelector(".mtk");
    var c = document.querySelector(".btn-close");
    var video1 = document.querySelector(".mtk> video");

    ss.addEventListener("click", function () {
        mtk.style.display = "block";
        video1.play();
    });
    c.addEventListener("click", function () {
        mtk.style.display = "none";
        video1.load();
    });
}


//返回顶部效果
var t = document.querySelector("#toTop");
window.onscroll = function () {
    console.log(document.documentElement.scrollTop > 500 || document.body.scrollTop > 500);
    if (document.documentElement.scrollTop > 500 || document.body.scrollTop > 500){
        t.style.display = "block";
    }else {
        t.style.display = "none";
    }
}

//点击返回顶部

t.addEventListener( 'click',function () {
    //让  dcrollto 支持平滑滚动
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})






if(document.body.offsetWidth>600) {
    var oo = document.querySelector("#oo");
    var ee = document.querySelector("#ee");
    oo.addEventListener("mouseover", function () {
        ee.style.top = "56px";
    });
    ee.addEventListener("mouseleave", function () {
        ee.style.top = "-420px";
    });
}